<?php $__env->startSection('css'); ?>
    <link rel="stylesheet" href="/assets/vendor/daterangepicker/daterangepicker.css">
    <style>
        .thumb {
            max-height: 60px;
        }
    </style>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="admin-content">

        <div class="am-cf am-padding">
            <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">订单管理</strong> /
                <small>Order Manage</small>
            </div>
        </div>
<br/>
        <?php echo $__env->make('admin.layouts._flash', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

        <div class="am-g">
            <div class="am-u-sm-12 am-u-md-12">
                <form class="am-form-inline" role="form" method="get">

                    <div class="am-form-group">
                        <input type="text" name="id" class="am-form-field am-input-sm" placeholder="订单号"
                               value="<?php echo e(Request::input('id')); ?>">
                    </div>

                    <div class="am-form-group">
                        <input type="text" name="customer_id" class="am-form-field am-input-sm" placeholder="会员编号"
                               value="<?php echo e(Request::input('customer_id')); ?>">
                    </div>

                    <div class="am-form-group">
                        <input type="text" name="total_price" class="am-form-field am-input-sm"
                               placeholder="订单金额(eg: >100)"
                               value="<?php echo e(Request::input('total_price')); ?>">
                    </div>

                    <div class="am-form-group">
                        <select data-am-selected="{btnSize: 'sm', maxHeight: 360, searchBox: 1}"
                                name="status" id="">
                            <option value="-1">订单状态</option>
                            <?php foreach($order_status as $key=>$value): ?>
                                <option value="<?php echo e($key); ?>" <?php if($key == Request::input('status')): ?> selected <?php endif; ?>>
                                    <?php echo e($value); ?>

                                </option>
                            <?php endforeach; ?>
                        </select>
                    </div>

                    <div class="am-form-group">
                        <input type="text" id="created_at" placeholder="选择下单时间" name="created_at"
                               value="<?php echo e(Request::input('created_at')); ?>" class="am-form-field am-input-sm"/>
                    </div>

                    <button type="submit" class="am-btn am-btn-default am-btn-sm">查询</button>
                </form>
            </div>

        </div>

        <div class="am-g">
            <div class="am-u-sm-12">
                <div class="order-list-box">
                    <ul class="order-list">
                <?php foreach($orders as $order): ?>
                        <li class="uc-order-item <?php echo e(order_color($order->status)); ?>">
                            <div class="order-detail">
                                <div class="order-summary">
                                    <div class="order-status"><?php echo e(order_status($order->status)); ?></div>
                                </div>
                                <table class="order-detail-table">
                                    <thead>
                                    <tr>
                                        <th class="col-main">
                                            <p class="caption-info"><?php echo e($order->created_at->format('Y年m月d日 H:i')); ?>

                                                <span class="sep">|</span>
                                                <?php echo e(isset($order->address->name) ? $order->address->name : ' '); ?> (<a href="tel:<?php echo e(isset($order->address->tel) ? $order->address->tel : ' '); ?>"><?php echo e(isset($order->address->tel) ? $order->address->tel : ' '); ?></a>)
                                                <span class="sep">|</span>
                                                订单号：<a href="//order.mi.com/user/orderView/1150426350013010"><?php echo e($order->id); ?></a>
                                            </p>
                                        </th>
                                        <th class="col-sub">
                                            <p class="caption-price">订单金额：<span class="num"><?php echo e(doubleval($order->total_price)); ?></span>元</p>
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td class="order-items">
                                            <ul class="goods-list">

                                                <?php foreach($order->order_products as $order_product): ?>
                                                    <li>
                                                        <div class="figure figure-thumb">
                                                            <a href="#" target="_blank">
                                                                <img src="<?php echo e($order_product->product->thumb); ?>"
                                                                     class="thumb"
                                                                     width="80" height="80"
                                                                     alt="<?php echo e($order_product->product->name); ?>">
                                                            </a>
                                                        </div>
                                                        <p class="name">
                                                            <a href="#"
                                                               target="_blank"><?php echo e($order_product->product->name); ?></a>
                                                        </p>
                                                        <p class="price"><?php echo e(doubleval($order_product->product->price)); ?>元
                                                            × <?php echo e($order_product->num); ?></p>
                                                    </li>
                                                <?php endforeach; ?>
                                            </ul>
                                        </td>
                                        <td class="order-actions">
                                            <a class="btn btn-small btn-line-gray"
                                               href="/shop/order/show/<?php echo e($order->id); ?>">订单详情</a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </li>
                <?php endforeach; ?>
                    </ul>
                </div>

                共 <?php echo e($orders->total()); ?> 条记录

                <div class="am-cf">
                    <div class="am-fr">

                        <?php echo $orders->appends(Request::all())->links(); ?>


                    </div>
                </div>

            </div>
        </div>
    </div>
    <?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
    <script src="/assets/vendor/daterangepicker/moment.js"></script>
    <script src="/assets/vendor/moment/locale/zh-cn.js"></script>
    <script src="/assets/vendor/daterangepicker/daterangepicker.js"></script>
    <script src="/assets/js/daterange_config.js"></script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>